/*
 * @FilePath: \ES02TC\pid_fuzzy.h
 * @Author: LATCOS-Lsp
 * @Date: 2016-09-01 23:18:38
 * @LastEditTime: 2023-12-08 10:26:48
 * @LastEditors: LATCOS-Lsp
 * @Description:
 */
#ifndef PID_H_
#define PID_H_

#include "stdint.h"




/*定义结构体和公用体*/
typedef struct
{
    float setpoint;  /*设定值*/
    float kp;        /*比例系数*/
    float ki;        /*积分系数*/
    float kd;        /*微分系数*/
    float lasterror; /*前一拍偏差*/
    float preerror;  /*前两拍偏差*/
    float deadband;  /*死区*/
    float output;    /*输出值*/
    float sumerror;
    float result;    /*物理量输出值*/
    float maximum;   /*输出值的上限*/
    float minimum;   /*输出值的下限*/

    float maxdKp; /*Kp增量的最大限值*/
    float mindKp; /*Kp增量的最小限值*/
    float qKp;    /*Kp增量的影响系数*/
    float maxdKi; /*Ki增量的最大限值*/
    float mindKi; /*Ki增量的最小限值*/
    float qKi;    /*Ki增量的影响系数*/
    float maxdKd; /*Kd增量的最大限值*/
    float mindKd; /*Kd增量的最小限值*/
    float qKd;    /*Kd增量的影响系数*/
    float deltaKd; 
    float deltaKi; 
    float deltaKp; 
} FUZZYPID;
void PMW_OUT(uint32_t pwmvalue);
void PID_Lambda_recorddata(PID_tune_t * chanletune, float realTemp);
#endif /* PID_H_ */
